#ifndef GRAPHICSCENE_H
#define GRAPHICSCENE_H

#include <QGraphicsScene>
#include "algo/Algorithm.h"
#include "base/Point.h"
#include "base/point_list.h"

class GraphicScene : public QGraphicsScene
{
public:
    static const int MAX_BOUNDS = 500;
    static const int MARGIN = 25;
    GraphicScene();
    void plotPoints(point_list);
    void plotHull();
    void setAlgo(Algorithm* algo) {
        _algo = algo;
        setOptimization(_with_opti);
    };
    void removePoint(Point* point);
    void show_hull(bool show_hull) { _show_hull = show_hull; plotHull(); };
    void setOptimization(bool with_opti);
    point_list getPoints() const { return _pts; };
    point_list getHull() const { return _hull; };

private:
    Algorithm* _algo;
    point_list _pts;
    point_list _hull;
    QGraphicsItemGroup* _edges_group;
    QGraphicsItemGroup* _points_group;
    QGraphicsItemGroup* _diamond_group;
    bool _show_hull;
    bool _with_opti;

};

#endif // GRAPHICSCENE_H
